package com.benyi.byiee.config;
 

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.benyi.byiee.util.HttpFileUtil;
import com.benyi.util.Config;

@Configuration
public class AppConfig {

	@Bean(name="customLogger")
	public Logger getCustomLogger(){
		Logger logger = LoggerFactory.getLogger("CustomLogger"); 
		return logger;
	}
	
	@Bean(name="config")
	public Config getWebConfig(){
		String file="classpath:config.ini";
		Config c=Config.getConfig(file);
		String sc = c.get("default_char_code");
		if(sc !=null && sc.length()>0) {
			HttpFileUtil.DEFAULT_CODE = sc;
		}
		return c;
	} 
	
}
  